How to make Fire alarm system using Arduino

Arduino Flame sensor Project

Components Required

About 16x2 LCD Display

The name "16x2 LCD display" comes from the fact that it has 16 columns and 2 rows, meaning we can display 32 characters on this screen. Characters can be alphabets, numbers, or custom-made characters. Each column is made from a 5x8 matrix of pixels (40 pixels per column).

Pinouts

LCD Display Interfacing with Arduino

VSS and LED- are grounded. VCC and LED+ connect to Arduino’s 5V. A Preset is connected to VEE to adjust contrast. LCD pins are connected as follows:

About Flame Sensor

Flame sensor is a type of detector , whose function is to detect presence of Flame. If a flame is detected, It provides a digital output signal with logic 0 and if no flame is present, then a digital output of logic 1.

Pinouts

Interfacing Flame sensor and buzzer with Arduino

Circuit Diagram

Circuit Diagram

Arduino Code


#include <LiquidCrystal.h>
LiquidCrystal lcd(6,7,8,9,10,11,12);
int flame,sensor=A0,detected=0,buzzer=A1;
void setup() 
{
  pinMode(sensor,INPUT);
  pinMode(buzzer,OUTPUT);
  lcd.begin(16,2);
}

void loop() 
{
  flame=digitalRead(sensor);
  lcd.clear();
  if(flame==detected)
  {
    lcd.print("Fire detected");
    lcd.setCursor(0,1);
    lcd.print("alarms are on");
    digitalWrite(buzzer,HIGH);
  }
  else
  {
    lcd.print("All set");
    lcd.setCursor(0,1);
    lcd.print("alarms are off");
    digitalWrite(buzzer,LOW);
  }
  delay(100);
}